package com.hcbd.tdwt.base;
import com.pangu.bdsdk2021.entity.terminalone.BDGLInfo;
import com.pangu.bdsdk2021.entity.terminalthree.BDSnrInfo;
import com.hcbd.tdwt.ui.xingyu.vo.UserMessageVO;

/**
 * - @Description:  北斗应急终端参数
 * - @Author:  LXJ
 * - @Time:  2019/4/22 9:52
 */
public class BeidouBoxParams {

    /**
     * 蓝牙名称
     */
    public static String blueName = null;

    /**
     * 终端ID
     */
    public static String bdBoxId = null;


    /**
     * 如果有信号的情况下，强行将波束信号提升一个达到4
     */
    public static void BeamSignalLifting(){
        int count = BDSnrInfo.obj.s1+BDSnrInfo.obj.s2+BDSnrInfo.obj.s3+BDSnrInfo.obj.s4+BDSnrInfo.obj.s5+BDSnrInfo.obj.s6+BDSnrInfo.obj.s7+BDSnrInfo.obj.s8+BDSnrInfo.obj.s9+BDSnrInfo.obj.s10+BDSnrInfo.obj.s11+BDSnrInfo.obj.s12+BDSnrInfo.obj.s13+BDSnrInfo.obj.s14+BDSnrInfo.obj.s15+BDSnrInfo.obj.s16+BDSnrInfo.obj.s17+BDSnrInfo.obj.s18+BDSnrInfo.obj.s19+BDSnrInfo.obj.s20+BDSnrInfo.obj.s21;
        if (count > 1) BDSnrInfo.obj.s21 = 4;

    }
    /**
     * 电量剩余百分比(%)
     */
    public static int kwh = 0;

    /**
     * 当前终端的北斗卡
     */
    public static String userCardNumber ="";

    /**
     * 通拨号码
     */
    public static String commandMachineNumber = null;


    /**
     * 发送频度
     */
    public static int sendFreq = -1;


    /**
     * 当前发送等待时间，0为空闲
     */
    public static int sentWaitSec = 0;

    /**
     * 最后一条的消息
     */
    public static UserMessageVO lastMsg = null;

    /**
     * 通信等级
     */
    public static  int cardType;

    /**
     * 终端是否正常连接
     */
    public static boolean isBoxConnectNormal = false;



    /**
     * 日出时间
     */
    public static String sunRise = "";

    /**
     * 日落时间
     */
    public static String sunSet = "";

    public static String gpsLongitude = "0";  // 经度字符
    public static String gpsLatitude = "0";  // 经度字符
    public static double gpsLonDou=0;  // 经度
    public static double gpsLatDou=0;  // 纬度
    public static double gpsAltitude = 0;  // 高度
    public static long bdTime = 0;  // 卫星时间（秒时间戳）
    public static float speed = 0;
    public static float accuracy=0;
    public static float bearing=0;



    /**
     * 保密标识
     */
    public static String ASecretIdentity = "-";

    /**
     * 初始化
     */
    public static void init() {
        blueName = null;
        bdBoxId = null;
        kwh = 0;
        userCardNumber = "";
        commandMachineNumber = null;
        sendFreq = -1;
        sentWaitSec = 0;
        //lastMsg = null;
        isBoxConnectNormal = false;
        sunRise = "";
        sunSet = "";
        gpsLongitude = "0";
        gpsLatitude = "0";
        gpsAltitude = 0;
        accuracy=0;
        BDSnrInfo.obj.s1 =0;
        BDSnrInfo.obj.s2 = 0;
        BDSnrInfo.obj.s3 =0;
        BDSnrInfo.obj.s4 =0;
        BDSnrInfo.obj.s5 = 0;
        BDSnrInfo.obj.s6 =0;
        BDSnrInfo.obj.s7 = 0;
        BDSnrInfo.obj.s8 =0;
        BDSnrInfo.obj.s9 = 0;
        BDSnrInfo.obj.s10= 0;
        BDSnrInfo.obj.s11 = 0;
        BDSnrInfo.obj.s12 =0;
        BDSnrInfo.obj.s13 =0;
        BDSnrInfo.obj.s14 =0;
        BDSnrInfo.obj.s15 =0;
        BDSnrInfo.obj.s16 =0;
        BDSnrInfo.obj.s17 =0;
        BDSnrInfo.obj.s18 =0;
        BDSnrInfo.obj.s19 =0;
        BDSnrInfo.obj.s20 =0;
        BDSnrInfo.obj.s21 =0;
        ImgSendManager.getInstance().clear(Constant.SEND_MSG_FAIL);
        ReceiveImgManager.clear();
    }

    /**
     * 几代北斗卡
     */
    public static  int card_model= 3;

    public static int horizontalAxis=21;//波束竖轴最大值
    public static int verticalAxis=60;//波束横轴最大值
    public static  int middleSignal=40;

    public static int getBdSignal(){
        int bdSignal=0;
        /*  if(BeidouBoxParams.card_model==3) {*/
        if (BDSnrInfo.obj.s1 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s2 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s3 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s4 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s5 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s6 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s7 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s8 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s9 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s10 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s11 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s12 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s13 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s14 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s15 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s16 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s17 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s18 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s19 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s20 >= middleSignal) {
            bdSignal++;
        }
        if (BDSnrInfo.obj.s21 >= middleSignal) {
            bdSignal++;
        }
       /* }else if(card_model==2){
            if (BDGLInfo.obj.s1 == 4) {
                bdSignal++;
            }
            if (BDGLInfo.obj.s2 == 4) {
                bdSignal++;
            }
            if (BDGLInfo.obj.s3 == 4) {
                bdSignal++;
            }
            if (BDGLInfo.obj.s4 == 4) {
                bdSignal++;
            }
            if (BDGLInfo.obj.s5 == 4) {
                bdSignal++;
            }
            if (BDGLInfo.obj.s6 == 4) {
                bdSignal++;
            }
            if (BDGLInfo.obj.s7 == 4) {
                bdSignal++;
            }
            if (BDGLInfo.obj.s8 == 4) {
                bdSignal++;
            }
            if (BDGLInfo.obj.s9 == 4) {
                bdSignal++;
            }
            if (BDGLInfo.obj.s10 == 4) {
                bdSignal++;
            }
        }*/
        return bdSignal;
    }

}
